Exploring the Fundamentals of 8085 Assembly Programming
After covering directives, program development tools, and Input/Output in assembly language programming, let's delve deeper into assembly language programs. This unit will begin by exploring simple assembly programs, which handle basic tasks such as data transfer, arithmetic operations, and shifts. A fundamental example includes determining the larger of two numbers. Subsequently, we'll progress to more intricate programs demonstrating the use of loops and various comparisons to accomplish tasks such as code conversion, character coding, and finding the largest value in an array. Additionally, this unit delves into more advanced arithmetic and string operations, as well as modular programming. For further details on these programming concepts, additional readings are recommended.
The 0–1 combinations that the computer decodes directly make up machine language code. However, the following issues with the machine language exist:
Computer manufacturers have created English-like terms to describe a machine's binary instruction in order to get around these problems. A mnemonic is a symbolic code that corresponds to each instruction. A specific instruction's mnemonic is made up of letters that allude to the task that the instruction is supposed to complete. The ADD mnemonic, for instance, is used to add two numbers. Machine language instructions can be written in symbolic form using these mnemonics, with one corresponding symbolic instruction for each machine instruction. We refer to this as an assembly language.
Assembly language provides extensive control over specific hardware and software components, enabling in-depth exploration of instruction sets, addressing modes, interrupts, and more.
Programs written in assembly generate smaller, more compact executable modules due to their close proximity to the machine. This proximity allows for the creation of highly optimized programs, resulting in faster execution.
Assembly language programs tend to be at least 30% denser than equivalent programs written in high-level languages. This density arises from the fact that compilers often produce lengthy code sequences for each instruction, whereas assembly language typically employs a single line of code for each instruction, particularly noticeable in string-related programs.
Assembly language offers programmers significant freedom, as it imposes few restrictions or rules, allowing for flexible system construction.
Assembly language is inherently machine-dependent, with each microprocessor featuring its own unique set of instructions. Consequently, assembly programs lack portability.
Programming in assembly requires a deep understanding of underlying hardware architecture, making it more complex and time-consuming compared to high-level languages.
Debugging and maintaining assembly code can be challenging due to its intricate and less readable nature compared to code written in higher-level languages.
Development in assembly language often demands more effort and expertise, potentially increasing development time and costs, and making it less accessible to beginners.
A source program is required before using the assembler. Instructions written in assembly language by the programmer make up the source program. These instructions have been written with mnemonic labels and opcodes. Programs written in assembly language and sent to the assembler must be machine-readable. You can keep source programs as paper tape or diskette files with the help of the text editor included in the Intellect development system. After that, you can give the assembler the generated source program file. The 8080 and 8085 microprocessors can run object code thanks to the assembler program, which handles the tedious operation of converting symbolic code.
The output of the assembler can be found in three different files: the object file, which is your program translated into object code; the list file, which is a printout of your source code, the object code produced by the assembler, and the symbol table; and the symbol-cross reference file, which is a list of such records.
Statement: Store the data byte 32H into memory location 4000H.
Statement: Exchange the contents of memory locations 2000H and 4000H.
Statement: Add the contents of memory location 4000H and 4001H and store the result in 4002H.
(4000H) = 14H
(4001H) = 89H
Result = 14H + 89H = 9DH
Statement: Subtract the contents of memory location 4001H from the memory location 2000H and place the result in memory location 4002H.
(4000H) = 51H
(4001H) = 19H
Result = 51H - 19H = 38H